
<!DOCTYPE html>
<html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
      <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
      <title>我的订单</title>
      <link rel="stylesheet" href="../../../css/aui.css" />
      <link rel="stylesheet" href="../../../css/iconfont/iconfont.css" />
      <link rel="stylesheet" href="../../../script/widget/Zepto/dropload.css">
      <link rel="stylesheet" href="../../../css/my/index.css">
  </head>
  <body style="cursor: pointer;">
    <!-- 订单列表 -->
    <section class="aui-content" id="list_content">
        <!--<div class="aui-card-list" onclick="order_details()">
            <div class="aui-card-list-header">
                <div class="col_center">
                    <div class="train_time field_info">06:30</div>
                    <div class="train_site field_info">上海虹桥</div>
                </div>
                <div class="train_icon"><i class="icon iconfont icon-huochepiao1"></i></div>
                <div class="col_center">
                    <div class="train_time">12:08</div>
                    <div class="train_site">上海虹桥</div>
                </div>
            </div>
            <div class="aui-card-list-content-padded aui-border-t">
                <div class="row_space">
                    <div class="col_left aui-col-xs-4">
                        <div class="train_field">日期</div>
                        <div class="field_info">01月09日</div>
                        <div class="train_field">状态</div>
                        <div class="field_info">已取消</div>
                    </div>
                    <div class="col_center aui-col-xs-4">
                        <div class="train_field">车次</div>
                        <div class="field_info">G6</div>
                        <div class="train_field">总额</div>
                        <div class="train_price">￥599</div>
                    </div>
                    <div class="col_right aui-col-xs-4">
                        <div class="train_field">座位</div>
                        <div class="field_info">二等座</div>
                    </div>
                </div>
            </div>
        </div>-->
    </section>
  </body>
</html>
<script src="../../../script/extend/jquery-3.3.1.min.js"></script>
<script src="../../../script/aui/api.js"></script>
<script src="../../../script/extend/doT.min.js"></script>
<script src="../../../script/widget/Zepto/dropload.min.js"></script>
<script src="../../../script/config.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<!--列表模板 start-->
<script id="interpolationtmpl" type="text/x-dot-template">
    {{ for(var prop in it) { }}
    {{ if(it[prop]['product_id'] == 1){ }}
    <div class="aui-card-list" onclick="order_details('{{=it[prop].user_orderid}}')" >
        <div class="aui-card-list-header">
            <div class="col_center">
                <div class="train_time field_info">{{= it[prop]['take_off_time'] }}</div>
                <div class="train_site field_info">{{= it[prop]['take_off_place'] }}</div>
            </div>
            <div class="train_icon"><i class="icon iconfont icon-feiji" style="color: white;"></i></div>
            <div class="col_center">
                <div class="train_time">{{= it[prop]['to_ground_time']}}</div>
                <div class="train_site">{{= it[prop]['to_ground_place'] }}</div>
            </div>
        </div>
        <div class="aui-card-list-content-padded aui-border-t">
            <div class="row_space">
                <div class="col_left aui-col-xs-4">
                    <div class="train_field">日期</div>
                    <div class="field_info">{{= it[prop]['take_off_date'] }}</div>
                    <div class="train_field">状态</div>
                    <div class="field_info">{{= it[prop]['status_text'] }}</div>
                </div>
                <div class="col_center aui-col-xs-4">
                    <div class="train_field">航班</div>
                    <div class="field_info">{{= it[prop]['flight_number'] }}</div>
                    <div class="train_field">总额</div>
                    <div class="train_price">￥{{= it[prop]['order_total_price'] }}</div>
                </div>
                <div class="col_right aui-col-xs-4">
                    <div class="train_field">舱位</div>
                    <div class="field_info">{{= it[prop]['shipping_space'] }}</div>
                </div>
            </div>
        </div>
    </div>
    {{ }else if(it[prop]['product_id'] == 5){ }}
    <div class="aui-card-list" onclick="order_details('{{=it[prop].user_orderid}}')" >
        <div class="aui-card-list-header">
            <div class="col_center">
                <div class="train_time field_info">{{= it[prop]['train_start_time'] }}</div>
                <div class="train_site field_info">{{= it[prop]['from_station_name'] }}</div>
            </div>
            <div class="train_icon"><i class="icon iconfont icon-huochepiao1"></i></div>
            <div class="col_center">
                <div class="train_time">{{= it[prop]['train_end_time']}}</div>
                <div class="train_site">{{= it[prop]['to_station_name'] }}</div>
            </div>
        </div>
        <div class="aui-card-list-content-padded aui-border-t">
            <div class="row_space">
                <div class="col_left aui-col-xs-4">
                    <div class="train_field">日期</div>
                    <div class="field_info">{{= it[prop]['train_date'] }}</div>
                    <div class="train_field">状态</div>
                    <div class="field_info">{{= it[prop]['status_text'] }}</div>
                </div>
                <div class="col_center aui-col-xs-4">
                    <div class="train_field">车次</div>
                    <div class="field_info">{{= it[prop]['train_code'] }}</div>
                    <div class="train_field">总额</div>
                    <div class="train_price">￥{{= it[prop]['order_total_price'] }}</div>
                </div>
                <div class="col_right aui-col-xs-4">
                    <div class="train_field">座位</div>
                    <div class="field_info">{{= it[prop]['train_seat_type'] }}</div>
                </div>
            </div>
        </div>
    </div>
    {{ }else{ }}
    <div class="aui-card-list" onclick="order_details('{{=it[prop].user_orderid}}')" >
        <div class="">
            <div class="hotel_title">
                <div class="train_icon" style="float: left;"><i class="icon iconfont icon-building" style="color: white;"></i></div>
                <div class="hotel_date">
                    <span>{{=it[prop].arrival_time}} - {{=it[prop].departure_time}}</span>
                </div>
            </div>
            <div class="hotel_name">
                <span>{{=it[prop].hotel_name}}</span>
            </div>
        </div>
        <div class="aui-card-list-content-padded aui-border-t">
            <div class="row_space">
                <div class="col_left aui-col-xs-4">
                    <div class="train_field">房型</div>
                    <div class="field_info">{{= it[prop]['room_type_name'] }}</div>
                </div>
                <div class="col_center aui-col-xs-4">
                    <div class="train_field">状态</div>
                    <div class="field_info">{{= it[prop]['status_text'] }}</div>
                </div>
                <div class="col_right aui-col-xs-4">
                    <div class="train_field">总额</div>
                    <div class="train_price">￥{{= it[prop]['order_total_price'] }}</div>
                </div>
            </div>
        </div>
    </div>
    {{ } }}
{{ } }}
</script>

<!--列表模板 end-->
<script type="text/javascript">
    //当前页数
    var pageIndex = 1;
    //最大页数
    var maxPage;
    var container = $("#list_content");
    apiready = function () {
        api.parseTapmode();
        getList(true);
        //下拉刷新
        push_down(function() {
            getList(true);
        });
        //上拉加载
        push_up(function() {
            getList(false);
        });
    }
    //酒店详情
    function order_details(user_orderid) {
        api.openWin({
            name: 'order_details_win',
            url: './order_details_win.html',
            pageParam: {
                user_orderid : user_orderid
            }
        });
    }
    function getList(isFresh) {
        if (isFresh) {
            pageIndex = 1;
            container.empty();
        } else {
            pageIndex++;
        }
        var param = {};
        param.url = Config.order.orderLists;
        param.data = {limit : 10,page : pageIndex};
        if (pageIndex > maxPage) {
            $toast('已滚动到底部',2000, 'm');//提示信息
            return false;
        }
        ajax(param,function(ret) {
            if(ret.code == 1) {
                if (ret.data.data.length == 0) {
                  $toast('暂无内容', 2000, 'm');
                  return false;
                }
                var dataInter = ret.data.data;
                var interText = doT.template($("#interpolationtmpl").text());
                container.append(interText(dataInter));
                pageIndex = ret.data.current_page;
                maxPage = parseInt(ret.data.last_page);
            } else {
                $toast(ret.msg, 2000, 'm');
            }
        });
        api.refreshHeaderLoadDone();
    }
</script>
